﻿
@using LKVMLMADMIN.Models;
@using PagedList.Mvc;
@using System.Globalization;
@using LKVMLMLib;

@{
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
    DateTime dateFrom = Convert.ToDateTime(ViewBag.DateFrom);
    DateTime dateTo = Convert.ToDateTime(ViewBag.Todate);
}
@using (Html.BeginForm("AddFundManager", "CongCu", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @class = "form-inline" }))
{
    <div id="wrapper">
        <div class="clear-fix"></div>
        <div class="row">
            <div style=" min-height: 110px; padding-left: 30px; ">
                <h3 class="page-header">Add Fund Manager</h3>
                @Html.DropDownList("user", new SelectList(@ViewBag.Username, "userid", "UserName", null), new { @class = "combobox", @Value = "1" })
                @Html.DropDownList("PRMT", new SelectList(@ViewBag.ParentMT, "id", "Name", null), new { @class = "form-control", @Value = "1" })
                
                <input type="text" name="Fromdate" class="form-control inputBox" value="@dateFrom.ToString("MM/dd/yyyy")">
                <input type="text" name="Todate" class="form-control inputBox" value="@dateTo.ToString("MM/dd/yyyy")">
                <button type="submit" class="btn_submit btn btn-default">Tìm kiếm</button>
            </div>
        </div>
        <!-- /.row -->
        <div class="row">
            <div class="col-lg-12">
                <div class="panel-body">
                    <div class="dataTable_wrapper">
                        <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                            <thead>
                                <tr style="font-family:'Times New Roman'">
                                    <th>Date</th>
                                    <th>UserName</th>
                                    <th>Payment Method</th>
                                    <th>Cash On Deposit</th>
                                    <th>BatchNo</th>                                                                     
                                </tr>
                            </thead>
                            <tbody style="font-family:'Times New Roman'">
                                                         
                                @foreach (var item in ViewBag.Showlist)
                                {                             
                                    <tr>
                                     
                                        <td>@String.Format("{0:d/MM/yyyy}", item.Date)</td>
                                        <td>@item.UserName</td>
                                        <td>@item.PayMentMedthod</td>                                     
                                        <td>@String.Format("{0:0.##}", item.CashonDeposit)</td>                                      
                                        <td>@item.BatChNo</td>                                    
                                    </tr>
                                }
                            </tbody>
                        </table>
                    </div>               
                </div>
            </div>
            <!-- /.panel -->
        </div>
    </div>
    <div class="dataTables_paginate paging_full_numbers pull-right" id="dyntable_paginate">
        @Html.PagedListPager((PagedList.IPagedList)Model, page => Url.Action("AddFundManager", new { page,  Fromdate = ViewBag.DateFrom, Todate = ViewBag.Todate , check =1}))
    </div>   
      <script src="~/Scripts/fm.datetator-fo.jquery.js"></script>
        <link href="~/Scripts/fm.datetator.jquery.css" rel="stylesheet" />
        <script src="~/Scripts/fm.datetator.jquery.js"></script>
        <script type="text/javascript">
            $('.inputBox').datetator();
            $('.confirmation').on('click', function () {
                return confirm('bạn có chắc chắn muốn xóa?');
            });
        </script>

}